{{ $series := .Scratch.Get "series" }}
{{ if gt (len $series.Sections) 0  }}
<div class="btn-group sidebar-dropdown">
    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ i18n "libraryArticlesInThisSeries" }} <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" role="menu">
      <li{{ if eq .RelPermalink $series.RelPermalink }} class="active"{{ end }}>
        <a href="{{ $series.RelPermalink }}">
          {{ $series.Param "sidebarName" | default $series.Title | safeHTML }}
        </a>
      </li>
      {{ range $series.Sections }}
      <li{{ if .InSection $ }} class="active"{{ end }}>
        <a href="{{ .RelPermalink }}">
          {{ .Param "sidebarName" | default .Title | safeHTML }}
        </a>
      </li>
      {{ end }}
    </ul>
  </div>
  {{ end }}